//
//  dataBaseHandle.h
//  Cup
//
//  Created by dllo on 15/4/29.
//  Copyright (c) 2015年 doll. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <sqlite3.h>
#import "PlayInfo.h"
#import "Read.h"

@protocol changeAlph <NSObject>

- (void)changeNight;
- (void)changeDay;

@end

@interface dataBaseHandle : NSObject
{
    //定义一个成员变量,用来指向数据库
    sqlite3 *dbPoint;
}

//单例
+ (instancetype)shareDB;
@property(nonatomic, assign)BOOL islogin;
@property(nonatomic, assign)BOOL state;
@property(nonatomic, assign)id<changeAlph>delegate;
- (void)night;
- (void)day;

@property(nonatomic, assign)NSInteger nighDayNum;

//打开数据库
- (void)openDB;
//创建歌曲表
- (void)creatPlayerTable;
//插入歌曲
-(void)insertPlayerWithTitle:(NSString *)title imgUrl:(NSString *)imgUrl musicid:(NSString *)musicid;
//查询歌曲
- (NSMutableArray *)selectPlayer;
//创建文章表
- (void)creatReadTable;
//插入文章
- (void)insertReadWithTitle:(NSString *)title picUrl:(NSString *)picUrl id:(NSString *)id;
//查询文章
- (NSMutableArray *)selectRead;
//删除歌曲
- (void)deletePlayerWithTitle:(NSString *)title;
//删除文章
- (void)deleteReadWithTitle:(NSString *)title;
//删除歌曲表
- (void)dropPlayerTable;
//删除文章表
- (void)dropReadTable;
//关闭数据库
- (void)closeDB;

@end
